<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input type="text" v-model="num">
        <button @click="getJoke">随机笑话</button>
        <p v-for="(item,index) in jokes">{{index+1}}.{{item}}</p>
    </div>

    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <script>
        const app=new Vue({
            el:'#app',
            data:{
                num:1,
                result:'',
                jokes:[]
            },
            methods:{
                getJoke(){
                    let that=this
                    axios.get(`https://autumnfish.cn/api/joke/list?num=${this.num}`).then(
                        res=>{
                            that.jokes=res.data.data
                        }
                    )
                }
            }
            
        })
    </script>
    
</body>
</html>